home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Languages / MPW Oberon 2.1168 / OInterfaces / AppleScript.mod < prev    next >
Encoding:
Text File  |  1995-08-10  |  5.1 KB  |  151 lines  |  [TEXT/MPS ]

  1. (*
  2.      File:        AppleScript.mod
  3.  
  4.      Contains:    AppleScript Specific Interfaces.
  5.  
  6.      Version:    Technology:    AppleScript 1.1
  7.                  Package:    Universal Interfaces 2.0 in “MPW Latest” on ETO #17
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs.applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. *)
  19.  
  20. (*$TAGS-*)
  21. (*$CALLING PASCAL*)
  22. MODULE AppleScript;
  23.  
  24. IMPORT SYSTEM, AppleEvents, Components, OSA, TextEdit;
  25.  
  26. (* $PUSH*)
  27. (* $ALIGN MAC68K*)
  28. (* $LibExport+*)
  29.  
  30. CONST
  31.     typeAppleScript*                = LONG("ascr");
  32.     kAppleScriptSubtype*            = typeAppleScript;
  33.     typeASStorage*                = typeAppleScript;
  34.  
  35. (**************************************************************************
  36.     Components.Component Selectors
  37. **************************************************************************)
  38.     kASSelectInit*                = $1001;
  39.     kASSelectSetSourceStyles*    = $1002;
  40.     kASSelectGetSourceStyles*    = $1003;
  41.     kASSelectGetSourceStyleNames* = $1004;
  42.  
  43. (**************************************************************************
  44.     OSAGetScriptInfo Selectors
  45. **************************************************************************)
  46.     kASHasOpenHandler*            = LONG("hsod");
  47.  
  48. (*
  49.         This selector is used to query a context as to whether it contains
  50.         a handler for the kAEOpenDocuments event. This allows "applets" to be 
  51.         distinguished from "droplets."  OSAGetScriptInfo returns false if
  52.         there is no kAEOpenDocuments handler, and returns the error value 
  53.         errOSAInvalidAccess if the input is not a context.
  54.     *)
  55. (**************************************************************************
  56.     Initialization
  57. **************************************************************************)
  58.  
  59. PROCEDURE ASInit*(scriptingComponent: Components.ComponentInstance; modeFlags: LONGINT; minStackSize: LONGINT; preferredStackSize: LONGINT; maxStackSize: LONGINT; minHeapSize: LONGINT; preferredHeapSize: LONGINT; maxHeapSize: LONGINT): OSA.OSAError;
  60.     (*$IF NOT GENERATINGCFM*)
  61.     INLINE PASCAL $2F3C, $1C, $1001, $7000, $A82A;
  62.     (*$END*)
  63. (*
  64.         ComponentCallNow(kASSelectInit, 28);
  65.         This call can be used to explicitly initialize AppleScript.  If it is
  66.         not called, the a scripting size resource is looked for and used. If
  67.         there is no scripting size resource, then the constants listed below
  68.         are used.  If at any stage (the init call, the size resource, the 
  69.         defaults) any of these parameters are zero, then parameters from the
  70.         next stage are used.  ModeFlags are not currently used.
  71.         Errors:
  72.         errOSASystemError        initialization failed
  73.     *)
  74. (*
  75.     These values will be used if ASInit is not called explicitly, or if any
  76.     of ASInit's parameters are zero:
  77. *)
  78.  
  79. CONST
  80.     kASDefaultMinStackSize*        = 4 * 1024;
  81.     kASDefaultPreferredStackSize* = 16 * 1024;
  82.     kASDefaultMaxStackSize*        = 16 * 1024;
  83.     kASDefaultMinHeapSize*        = 4 * 1024;
  84.     kASDefaultPreferredHeapSize*    = 16 * 1024;
  85.     kASDefaultMaxHeapSize*        = 32 * 1024 * 1024;
  86.  
  87. (**************************************************************************
  88.     Source Styles
  89. **************************************************************************)
  90.  
  91. PROCEDURE ASSetSourceStyles*(scriptingComponent: Components.ComponentInstance; sourceStyles: TextEdit.STHandle): OSA.OSAError;
  92.     (*$IF NOT GENERATINGCFM*)
  93.     INLINE PASCAL $2F3C, $4, $1002, $7000, $A82A;
  94.     (*$END*)
  95. (*
  96.         ComponentCallNow(kASSelectSetSourceStyles, 4);
  97.         Errors:
  98.         errOSASystemError        operation failed
  99.     *)
  100. PROCEDURE ASGetSourceStyles*(scriptingComponent: Components.ComponentInstance; VAR resultingSourceStyles: TextEdit.STHandle): OSA.OSAError;
  101.     (*$IF NOT GENERATINGCFM*)
  102.     INLINE PASCAL $2F3C, $4, $1003, $7000, $A82A;
  103.     (*$END*)
  104. (*
  105.         ComponentCallNow(kASSelectGetSourceStyles, 4);
  106.         Errors:
  107.         errOSASystemError        operation failed
  108.     *)
  109. PROCEDURE ASGetSourceStyleNames*(scriptingComponent: Components.ComponentInstance; modeFlags: LONGINT; VAR resultingSourceStyleNamesList: AppleEvents.AEDescList): OSA.OSAError;
  110.     (*$IF NOT GENERATINGCFM*)
  111.     INLINE PASCAL $2F3C, $8, $1004, $7000, $A82A;
  112.     (*$END*)
  113. (*
  114.         ComponentCallNow(kASSelectGetSourceStyleNames, 8);
  115.         This call returns an AEList of styled text descriptors the names of the
  116.         source styles in the current dialect.  The order of the names corresponds
  117.         to the order of the source style constants, below.  The style of each
  118.         name is the same as the styles returned by ASGetSourceStyles.
  119.         
  120.         Errors:
  121.         errOSASystemError        operation failed
  122.     *)
  123. (*
  124.     Elements of TextEdit.STHandle correspond to following categories of tokens, and
  125.     accessed through following index constants:
  126. *)
  127.  
  128. CONST
  129.     kASSourceStyleUncompiledText* = 0;
  130.     kASSourceStyleNormalText*    = 1;
  131.     kASSourceStyleLanguageKeyword* = 2;
  132.     kASSourceStyleApplicationKeyword* = 3;
  133.     kASSourceStyleComment*        = 4;
  134.     kASSourceStyleLiteral*        = 5;
  135.     kASSourceStyleUserSymbol*    = 6;
  136.     kASSourceStyleObjectSpecifier* = 7;
  137.     kASNumberOfSourceStyles*        = 8;
  138.  
  139. (* Gestalt selectors for AppleScript *)
  140.     gestaltAppleScriptAttr*        = LONG("ascr");
  141.     gestaltAppleScriptVersion*    = LONG("ascv");
  142.  
  143.     gestaltAppleScriptPresent*    = 0;
  144.     gestaltAppleScriptPowerPCSupport* = 1;
  145.  
  146.  
  147. (* $ALIGN RESET*)
  148. (* $POP*)
  149.  
  150.  END AppleScript.
  151.